home *** CD-ROM | disk | FTP | other *** search
- The LASERPRT.PAS file produces a unit which is used for
- printing reports with a HP LaserJet or compatible printer.
- Most of the commonly used formatting commands have been
- provided as functions. Each function returns a string
- containing the appropriate HP PCL control codes. It is
- anticipated that the function calls would be made within a
- "WRITE(lst," or a "WRITELN(lst," statement.
-
- One of the most difficult problems I had in trying to format
- my printouts was using the shading feature to shade every
- other line. Ted Dickens, Sysop of the HP Forum (76701,272)
- figured out the right way to accomplish this task. The
- following is an edited version of several messages he wrote
- explaining how this is accomplished. In addition, the
- sample program included in the LZRTPU.ZIP file
- (SHADETXT.PAS) was originally written by Ted to demonstrate
- this procedure. I have modified it to take advantage of the
- LASERPRT.TPU functions.
-
- ============================================================
- There are three different ways to position the cursor on a
- LaserJet+ (or later): row/col, dot/dot, and
- decipoint/decipoint. The three are not interchangeable.
-
- For the sake of this discussion, assume the top margin is 0
- lines and that the left unprintable margin is 0.25 inches.
-
- The decipoint/decipoint control sequence, <esc>&a720v1440H,
- says move the cursor to 1" (720/720) from the top edge and
- 2.25" (1440/720 + 0.25" unprintable region) from the left
- edge.
-
- The dot/dot control sequence, <esc>*p300y600X, does exactly
- the same thing. With either command, the cursor will be
- positioned exactly 1" from the top of the paper and 2.25"
- from the left edge. If you were to draw a single dot --
- that's where it would appear.
-
- But, even though there are 10 characters per inch and 6 rows
- per inch, the row/col control sequence, <esc>&a6r20C, will
- NOT leave the cursor at the same position.
-
- The cursor WILL be left 2.25" from the left edge. But the
- vertical spacing will be at 6.75 rows from the top -- not 6
- as one might think.
-
- There's a pretty good reason for this. Think of a character
- cell:
- +-------+
- | |
- | |
- | | /______ Baseline is set to 75%
- | | \ of the current VMI setting
- +-------+
-
- This little extra nudge moves the cursor so that the top of
- the character cell will fall at the specified location. In
- this example -- the TOP of the first character we print
- should appear 1" from the top edge and 2.25" from the left
- edge.
-
- In fact, the only time that the difference is even noticed
- is when mixing text and graphics. (Shading is a graphic
- function on the LaserJets.)
-
- Therefore, when shading a line of text, the shading
- procedure should:
-
- 1. move the cursor up 75 percent of the height of the
- current line height;
-
- 2. fill the desired area;
-
- 3. move the cursor down 75 percent of the height of the
- current line height;
-
- 4. print the line of text.
-
- Thus, the up and down cursor movements are:
-
- Line Height Movement
- lpi (decipoints) (decipoints)
- --------- ------------ ------------
- 4 180 135
- 6 120 90
- 8 90 67.5
-
- (line height = (1 inch/X lpi)*(720 decipoints per inch)
- ============================================================
-
- The principles discussed above are used in three sample
- programs. The first (SHADETXT.PAS) is included in the
- LZRTPU.ZIP file. The other two (SHADE1.PAS and SHADE2.PAS)
- are available in Library 0 of the HP forum. SHADETXT.PAS is
- a sample program showing alternating lines of shaded text.
- SHADE1.PAS produces a pattern similar to "green bar" paper
- in the portrait format while SHADE2.PAS does the same thing
- except in the landscape format.
-
- By the way, if you browse the HP library, you will see a
- SHADE3.PAS file. That is the original version of the
- SHADETXT.PAS program.
-
-
- ----------------end-of-author's-documentation---------------
-
- Software Library Information:
-
- This disk copy provided as a service of
-
- Public (software) Library
-
- We are not the authors of this program, nor are we associated
- with the author in any way other than as a distributor of the
- program in accordance with the author's terms of distribution.
-
- Please direct shareware payments and specific questions about
- this program to the author of the program, whose name appears
- elsewhere in this documentation. If you have trouble getting
- in touch with the author, we will do whatever we can to help
- you with your questions. All programs have been tested and do
- run. To report problems, please use the form that is in the
- file PROBLEM.DOC on many of our disks or in other written for-
- mat with screen printouts, if possible. PsL cannot debug pro-
- programs over the telephone, though we can answer questions.
-
- Disks in the PsL are updated monthly, so if you did not get
- this disk directly from the PsL, you should be aware that the
- files in this set may no longer be the current versions. Also,
- if you got this disk from another vendor and are having prob-
- lems, be aware that some files may have become corrupted or
- lost by that vendor. Get a current, working disk from PsL.
-
- For a copy of the latest monthly software library newsletter
- and a list of the 2,000+ disks in the library, call or write
-
- Public (software) Library
- P.O.Box 35705 - F
- Houston, TX 77235-5705
-
- Orders only:
- 1-800-2424-PSL
- MC/Visa/AmEx/Discover
-
- Outside of U.S. or in Texas
- or for general information,
- Call 1-713-524-6394
-
- PsL also has an outstanding
- catalog for the Macintosh.
-
-